import Vue from 'vue'

import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import VueI18n from 'vue-i18n'
import jsCookie from 'js-cookie'
import zh from './zh'
import en from './en'
if (!jsCookie.get('lang')) {
  jsCookie.set('lang', 'en')
}
Vue.use(VueI18n)
const i18n = new VueI18n({
  locale: jsCookie.get('lang') || 'en', // set locale
  messages: {
    en: {
      he: 'home',
      ...enLocale,
      ...en
    },
    zh: {
      he: '首页',
      ...zhLocale,
      ...zh
    }
  }
})
export default i18n
